import request from '@/utils/request'

// 查询订单列表（新版）
export function listSellerOrder(query) {
  return request({
    // url: '/purchase/sellerOrder/selectOrderList',
    url: '/order/order/sellerOrder/selectOrderListNew',
    method: 'get',
    params: query
  })
}

// 查询已组包订单列表
export function selectHandoverOrderList(query) {
  return request({
    // url: '/purchase/sellerOrder/selectOrderList',
    url: '/order/ae/handoverOrders/selectHandoverOrderList',

    // url: '/ae/handoverOrders/selectHandoverOrderDetails',
    method: 'get',
    params: query
  })
}

// 查询已组包订单中的子订单列表
export function selectHandoverOrderDetails(query) {
  return request({
    url: '/order/ae/handoverOrders/selectHandoverOrderDetails',
    method: 'get',
    params: query
  })
}

// 老订单商品入库
export function oldOrderSkuWarehousing(query) {
  return request({
    url: '/order/purchase/fpx/oldOrderSkuWarehousing',
    method: 'get',
    params: query
  })
}

// 采购订单驳回
export function reviewFailed(query) {
  return request({
    url: '/order/order/sellerOrder/reviewFailed',
    method: 'post',
    data: query
  })
}

// 获取已填写的国内运单号和购买凭证
export function querySendGoodsInfo(query) {
  return request({
    url: '/order/order/sellerOrder/queryPurchaseInfo',
    method: 'get',
    params: query
  })
}

// 获取商品的规格（长宽高体积）
export function getOrderSkuPackageInfo(query) {
  return request({
    url: '/order/AeLogistics/getOrderSkuPackageInfo',
    method: 'get',
    params: query
  })
}

// 获取线上物流方案
export function logisticsServiceQueryNew(query) {
  return request({
    url: '/order/AeLogistics/logisticsServiceQueryNew',
    method: 'post',
    data: query
  })
}


// 获取线下物流信息
export function getLpCode() {
  return request({
    url: '/order/purchase/fpx/getLpCode',
    method: 'get',
  })
}

// 查看申报信息
export function declareProductInfo(query) {
  return request({
    url: '/order/gather/AeLogistics/getDeclareProductInfo',
    method: 'get',
    params: query
  })
}

// 判断商品上架状态
export function isInBound(query) {
  return request({
    url: '/order/purchase/fpx/isInBound',
    method: 'get',
    params: query
  })
}

// 填写线上发货物流信息获取物流方案
export function editOnlineLogisticsInfo(data) {
  return request({
    url: '/order/AeLogistics/logisticsServiceQueryOld',
    method: 'get',
    params: data
  })
}

// 截单失败
export function cutOrderFail(data) {
  return request({
    url: "/order/purchase/fpx/cutOrderFail",
    method: 'post',
    data: data
  })
}

// 截单成功
export function cutOrderSuccess(data) {
  return request({
    url: "/order/purchase/fpx/cutOrderSuccess",
    method: 'post',
    data: data
  })
}


// 线下发货
export function sendoutGoods(query) {
  return request({
    url: '/order/purchase/fpx/sendOutOrderToFPX',
    method: 'post',
    data: query
  })
}


// 选择线上物流订单
export function chooseOnlineLogistics(data) {
  return request({
    url: '/order/purchase/sellerOrder/updateWarehouseCarrierService',
    method: 'get',
    params: data
  })
}

// 线上发货
export function createWarehouseOrder(data) {
  return request({
    url: '/order/AeLogistics/createWarehouseOrder',
    method: 'post',
    data: data
  })
}

// 菜鸟线上发货
export function createAeWarehouseOrder(data) {
  return request({
    url: '/order/ae/order/createWarehouseOrder',
    method: 'post',
    data: data
  })
}

// 其他发货方式
export function createOtherWarehouseOrder(data) {
  return request({
    url: '/order/ae/order/createOtherWarehouseOrder',
    method: 'get',
    params: data
  })
}

// 上传购买凭证
export function uploadProof(data) {
  return request({
    url: "/order/order/sellerOrder/uploadProof",
    method: 'post',
    data: data
  })
}

// 填写国内运单号
export function confirmDomesticWaybill(query) {
  return request({
    url: '/freight/purchase/fpx/purchased',
    method: 'post',
    data: query
  })
}


// 获取订单sku信息和包裹信息
export function getAeOrderSkuPackageInfo(query) {
  return request({
    url: '/order/order/sellerOrder/getOrderSkuPackageInfo',
    method: 'get',
    params: query
  })
}

// 获取物流方案
export function queryLogisticsPlan(query) {
  return request({
    url: '/ae/erp/erpLogistics/logisticsServiceQuery',
    method: 'post',
    data: query
  })
}


// 获取推荐物流方案
export function logisticsServiceQuery(query) {
  return request({
    url: '/freight/freight/recommended/logistics',
    method: 'post',
    data: query
  })
}

// 仓储发货
export function getWarehouseProBySkuCode(query) {
  return request({
    url: '/freight/purchase/orderStoreSend/determineInventory',
    method: 'post',
    data: query
  })
}

// 补充货仓
export function warehouseProReplenish(query) {
  return request({
    url: '/order/ae/order/warehouseProReplenish',
    method: 'post',
    data: query
  })
}

// 获取当前订单的采购链接
export function getOrderSkuBuyLink(query) {
  return request({
    url: '/order/ae/order/getOrderSkuBuyLink',
    method: 'get',
    params: query
  })
}

// 修改当前订单的采购链接
export function updateOrderSkuBuyLink(query) {
  return request({
    url: '/order/ae/order/updateOrderSkuBuyLink',
    method: 'get',
    params: query
  })
}

// 截单成功选择仓储
export function cutOrderStorage(query) {
  return request({
    url: '/order/purchase/fpx/cutOrderStorage',
    method: 'post',
    data: query
  })
}


// 截单成功退货
export function cutOrderGoods(query) {
  return request({
    url: '/order/purchase/fpx/cutOrderGoods',
    method: 'get',
    params: query
  })
}

// 查看子订单的国内运单号
export function querySendGoodsInfoList(query) {
  return request({
    url: '/order/purchase/fpx/querySendGoodsInfoList',
    method: 'get',
    params: query
  })
}

// 获取订单店铺层级关系
export function getErpAgentBranchInfo(query) {
  return request({
    url: '/user/distribution/user/getErpAgentBranchInfo',
    method: 'get',
    params: query
  })
}

// 库存列表
export function WarehouseProBySkuCode(query) {
  return request({
    url: '/order/ae/order/getWarehouseProBySkuCode',
    method: 'get',
    params: query
  })
}

// 仓储发货
export function ChooseWarehouseShipment(query) {
  return request({
    url: '/order/ae/order/chooseWarehouseShipment',
    method: 'get',
    params: query
  })
}

// 手动创建订单日志
export function createOrderLog(query) {
  return request({
    url: '/order/purchase/sellerOrder/createOrderLog',
    method: 'post',
    data: query
  })
}

// 获取订单驳回和截单记录
export function getRejectAndCutOffRecord(query) {
  return request({
    url: '/order/order/sellerOrder/getRejectAndCutOffRecord',
    method: 'post',
    data: query
  })
}


// 获取截单订单数量
export function redReminderForCutOffOrder(query) {
  return request({
    url: '/order/order/sellerOrder/cutAndErrorRedReminder',
    method: 'get',
    params: query
  })
}

// 已采购订单设置备注
export function setOrderMemo(query) {
  return request({
    url: '/order/order/sellerOrder/setOrderMemo',
    method: 'get',
    params: query
  })
}

// 同步线上物流订单
export function synchronizationWarehouseOrder(query) {
  return request({
    url: '/order/ae/order/synchronizationWarehouseOrder',
    method: 'post',
    data: query
  })
}

// 获取出单量统计
export function getOrderCountByCode(query) {
  return request({
    url: '/order/order/storeChildOrder/getOrderCountByCode',
    method: 'get',
    params: query
  })
}
